package com.projectx.action.chat.DevoteActivity;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.projectx.R;

import java.util.List;

public class DevoteDialogActivityAdapter extends RecyclerView.Adapter<DevoteDialogActivityAdapter.VH> {

    private Context context;
    private String[] data;
    private String[] count;
    public DevoteDialogActivityAdapter(Context context,String [] data, String[] count) {
        this.context = context;
        this.data = data;
        this.count=count;
    }

    @NonNull
    @Override
    public VH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.activity_devote_text, parent, false);
        return new VH(view);
    }

    @Override
    public void onBindViewHolder(@NonNull VH holder, int position) {
        holder.data.setText(data[position]);
        holder.count.setText(count[position]);
    }

    @Override
    public int getItemCount() {
        return data.length;
    }

    public static class VH extends RecyclerView.ViewHolder {

        TextView data,count;
        ImageView click;
        public VH(@NonNull View itemView) {
            super(itemView);
            data = itemView.findViewById(R.id.data);
            click=itemView.findViewById(R.id.click);
            count=itemView.findViewById(R.id.count);
        }
    }
}
